<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>综合案例</title>
  </head>
  <body>
    <script>
      let money = 10000;

      while (true) {
        let num = +prompt(`请你选择操作：
        1.存钱
        2.取钱
        3.查看余额
        4.退出
        `);
        if (num === 4) {
          break;
        }
        switch (num) {
          case 1:
            let cun = +prompt("请输入你要存的余额");
            money = money + cun;
            break;
          case 2:
            let qu = +prompt("请输入你要取的余额");
            money = money - qu;
            break;
          case 3:
            alert(`你的余额为${money}`);
            break;
          default:
            alert(`操作失误`);
        }
      }
    </script>
  </body>
</html>
